import 'package:json_annotation/json_annotation.dart';

@JsonSerializable()
class TypeMap {
  final int typeId;
  final String typeName;
  final int typeStatus;
  final int scene;
  final String createTime;

  TypeMap({
    required this.typeId,
    required this.typeName,
    required this.typeStatus,
    required this.scene,
    required this.createTime,
  });

  factory TypeMap.fromJson(Map<String, dynamic> json) {
    return TypeMap(
        typeId: json['typeId'] ?? '',
        typeName: json['typeName'] ?? '',
        typeStatus: json['typeStatus'] ?? '',
        scene: json['scene'] ?? '',
        createTime: json['createTime']
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'typeId': typeId,
      'typeName': typeName,
      'typeStatus': typeStatus,
      'scene': scene,
      'createTime': createTime
    };
  }
}